package org.kmfdm.horrorscope.service.beans;

import org.kmfdm.horrorscope.core.dao.CustomerDAO;
import org.kmfdm.horrorscope.core.dao.UserDAO;
import org.kmfdm.horrorscope.metamodel.Customer;
import org.kmfdm.horrorscope.service.RegisterCustomer;


public class RegisterCustomerImpl implements RegisterCustomer {
		
		private UserDAO daoU;
		private CustomerDAO daoC;
		
		
	public void registerCustomer(Customer c){
		
		if(daoU.findUserByUsername(c.getUsername()).isEmpty()){
			daoC.createCustomer(c);
		
		}
		
	}
	
	public UserDAO getDaoU() {
		return daoU;
	}


	public void setDaoU(UserDAO daoU) {
		this.daoU = daoU;
	}


	public CustomerDAO getDaoC() {
		return daoC;
	}


	public void setDaoC(CustomerDAO daoC) {
		this.daoC = daoC;
	}
	
	
}
